<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button>点击之后有5秒跳转</button>

    <script>
        var time = 5
        var btn = document.querySelector('button')

        btn.addEventListener('click', function () {

            setInterval(function () {
                btn.innerText = '点击之后有' + time + '秒跳转'
                time--
            }, 3000)
        })

        setTimeout(function () {
            location.href = "https://www.bilibili.com/"
        }, 3000)

    </script>


    <script>

    </script>
</body>

</html>